import { DataBaseConfig } from "./DataBaseConfig";
export class DataBaseCreationConfig {
  databaseName = ""
  connection = new DataBaseConfig()

  constructor (databaseName = "", connection = new DataBaseConfig()){
    this.databaseName = databaseName
    this.connection = connection
  }

    static isValid(obj){
        let valid = true
        valid &= obj.databaseName != null
        valid &= obj.connection != null
        if (valid){
          valid &= DataBaseConfig.isValid(obj.connection)
        }

        if (!valid){
            console.log(obj)
          console.error(
            "Object must be contain {databaseName, Connection {database, driverClass, userName, password, maxPoolSize, minPoolSize, jdbcUrl, initialPoolSize, requiredPassword}} membres"
          );
        }
        return valid;
    }
}